﻿using ConfExpert.Utility;
using DevTeam;
using System;
namespace ConfExpert.Forms.Depo.Cikis
{
    public partial class BarkodEkle : XPopupForm
    {
        public BarkodEkle()
        {
            InitializeComponent();
        }

        private void BarkodEkle_Load(object sender, EventArgs e)
        {
            
            EnableBarcodeType(0);
            BarcodeRead += PO_BarcodeRead;
            btnKaydet.ItemClick += btnKaydet_ItemClick;
            AppSession.BarkodEkle = string.Empty;
        }

        void PO_BarcodeRead(int Type, int Barcode)
        {
            if (Type == 0)
            {
                if (!memoEdit1.Text.Contains(Barcode.ToString() + Environment.NewLine))
                    memoEdit1.Text += Barcode.ToString() + Environment.NewLine;
            }
        }

        public string RollIds = string.Empty;
        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string[] lst = memoEdit1.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
            RollIds = String.Join(",", lst);
            AppSession.BarkodEkle = RollIds;

            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

    }
}
